<?php
include('class.php');
session_start();
$id=$_POST['id'];
$sname=$_POST['staff'];
$mname=$_SESSION['name'];
$detail=$_POST['detail'];
$db=new DB();
$i=$db->sendAssignment($id,$sname,$mname,$detail);

 Header('Refresh:0.01;url=DailyAssignment.php');
        if($i==0){
			/*echo"Success!!<br>Return after 3 seconds!";*/
			
			echo "<script type='text/javascript' language='javascript'>
              alert('Send Assignment Successfully!');
             </script>";
			 Header('Refresh:0.01;url=DailyAssignment.php');

		}
        else {
			echo"<script type='text/javascript' language='javascript'>
              alert('The name and id is wrong!');
             </script>";
		}
 Header('Refresh:0.01;url=DailyAssignment.php');

$db->close();
?>
